Skip to content

Conversation

@iseeyuan
Copy link
Contributor

Summary:
Apply output layer pruning if we are using a model trained with a large output vocabulary to use as a classification task to output only smaller set of vocabulary. The output interface is ensured to be the same as unpruned model.

e.g., if the last linear layer has 2048 x 128k shape, and we trained the model to output only 20 output vocab, then we can prune away the last layer to have a shape of 2048 x 20. But we still expand the 1,20 output shape to 1,128k so that the app consuming the model outputs don't need to change.

Differential Revision: D62143905

@pytorch-bot
Copy link

pytorch-bot bot commented Sep 17, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/5426

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 20d7986 with merge base ad95e46 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 17, 2024
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D62143905

Copy link
Contributor Author

@iseeyuan iseeyuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for putting it in the source transform! Please make sure both OSS and internal tests pass.

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D62143905

iseeyuan pushed a commit to iseeyuan/executorch-1 that referenced this pull request Sep 17, 2024
Summary:
Pull Request resolved: pytorch#5426

Apply output layer pruning if we are using a model trained with a large output vocabulary to use as a classification task to output only smaller set of vocabulary. The output interface is ensured to be the same as unpruned model.

e.g., if the last linear layer has 2048 x 128k shape, and we trained the model to output only 20 output vocab, then we can prune away the last layer to have a shape of 2048 x 20. But we still expand the 1,20 output shape to 1,128k so that the app consuming the model outputs don't need to change.

Reviewed By: iseeyuan

Differential Revision: D62143905
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D62143905

iseeyuan pushed a commit to iseeyuan/executorch-1 that referenced this pull request Sep 17, 2024
Summary:
Pull Request resolved: pytorch#5426

Apply output layer pruning if we are using a model trained with a large output vocabulary to use as a classification task to output only smaller set of vocabulary. The output interface is ensured to be the same as unpruned model.

e.g., if the last linear layer has 2048 x 128k shape, and we trained the model to output only 20 output vocab, then we can prune away the last layer to have a shape of 2048 x 20. But we still expand the 1,20 output shape to 1,128k so that the app consuming the model outputs don't need to change.

Reviewed By: tarun292, iseeyuan

Differential Revision: D62143905
Summary:
Pull Request resolved: pytorch#5426

Apply output layer pruning if we are using a model trained with a large output vocabulary to use as a classification task to output only smaller set of vocabulary. The output interface is ensured to be the same as unpruned model.

e.g., if the last linear layer has 2048 x 128k shape, and we trained the model to output only 20 output vocab, then we can prune away the last layer to have a shape of 2048 x 20. But we still expand the 1,20 output shape to 1,128k so that the app consuming the model outputs don't need to change.

Reviewed By: tarun292, iseeyuan

Differential Revision: D62143905
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D62143905

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 2afcd96.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants